package com.itzhanshen.easyexcel;

import com.alibaba.excel.EasyExcel;

import java.util.ArrayList;
import java.util.List;
// 写
public class EasyExcelDemo02 {
    public static void main(String[] args) {
        List<Emp> empList = new ArrayList<>();
        empList.add(new Emp(1,"Tom1",10,"男","测试数据111"));
        empList.add(new Emp(2,"Tom2",11,"男","测试数据222"));
        empList.add(new Emp(3,"Tom3",12,"男","测试数据333"));
        empList.add(new Emp(4,"Tom4",13,"男","测试数据444"));
        empList.add(new Emp(5,"Tom5",14,"男","测试数据555"));
        empList.add(new Emp(6,"Tom6",15,"男","测试数据666"));
        // 写
        EasyExcel.write("D:/2.xls",Emp.class)
                .sheet("第一小章").doWrite(empList);
        System.out.println("已成功写入");
    }
}
